package moe.kotake.webbehw.advice;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class exceptionHandler {
    @ExceptionHandler(RuntimeException.class)
    public ResponseEntity<String> myExceptionHandler(RuntimeException e){
        return ResponseEntity.badRequest()
                .body("异常！内容为："+e.getMessage());
    }
}
